#include<bits/stdc++.h>
using namespace std;
const int ma=0x7fffffff;
const int len=1e5+5;
int arr[len];
int main() {
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++) {
        scanf("%d",&arr[i]);
    }
    sort(arr+1,arr+1+n);
    for(int i=1,j=2;i<=n&&j<=n&&i<j;j++) {
        if(arr[i]<arr[j]) {
            arr[i]=ma;
            i++;
        }
    }
    for(int i=1;i<=n;i++) {
        if(arr[i]!=ma) {
            ans++;
            //cout<<i<<' ';
        }
    }
    cout<<ans;
    return 0;
}
